package cn.edu.zust.fileservice.controller;

import cn.edu.zust.fileservice.untils.QiniuKodoUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class QiniuController {
    @Resource
    QiniuKodoUtil qiniuKodoUtil;

    @PostMapping("/uploadPicture")
    public String upload(@RequestPart("file") MultipartFile multipartFile) {
        return qiniuKodoUtil.uploadPictures(multipartFile);
    }

    @PostMapping("/uploadVideo")
    public String uploadVideos(@RequestPart("file") MultipartFile multipartFile) {
        return qiniuKodoUtil.uploadVideos(multipartFile);
    }
}
